#include "QtUI/Impl/QtPackageViewImpl.qth"
#include "QtUI/Impl/QtPackageViewImpl.moh"
#include "QtUI/QtPackageViewBase.hpp"

namespace QtUI { namespace Impl
{

QtPackageViewImpl::QtPackageViewImpl( QtPackageViewBase& packageView)
	: rPackageView_( packageView)
{
	connect( this, SIGNAL( packageAddedSignal( Model::Package*, Model::Package*)), this, SLOT( packageAddedSlot( Model::Package*, Model::Package*)), Qt::QueuedConnection);
	connect( this, SIGNAL( packageRemovedSignal( Model::Package*, Model::Package*)), this, SLOT( packageRemovedSlot( Model::Package*, Model::Package*)), Qt::QueuedConnection);
	connect( this, SIGNAL( rootRequirementAddedSignal( Model::Package*, Model::Requirement*)), this, SLOT( rootRequirementAddedSlot( Model::Package*, Model::Requirement*)), Qt::QueuedConnection);
	connect( this, SIGNAL( rootRequirementRemovedSignal( Model::Package*, Model::Requirement*)), this, SLOT( rootRequirementRemovedSlot( Model::Package*, Model::Requirement*)), Qt::QueuedConnection);
}

// ---------------------------------------------------------------------------------------------------------------------

void QtPackageViewImpl::packageAddedSlot( Model::Package* pParentPackage, Model::Package* pNewPackage)
{
	rPackageView_.handlePackageAdded( pParentPackage, pNewPackage);
}

// ---------------------------------------------------------------------------------------------------------------------

void QtPackageViewImpl::packageRemovedSlot( Model::Package* pParentPackage, Model::Package* pRemovedPackage)
{
	rPackageView_.handlePackageRemoved( pParentPackage, pRemovedPackage);
}

// ---------------------------------------------------------------------------------------------------------------------

void QtPackageViewImpl::rootRequirementAddedSlot( Model::Package* pPackage, Model::Requirement* pAddedRequirement)
{
	rPackageView_.handleRootRequirementAdded( pPackage, pAddedRequirement);
}

// ---------------------------------------------------------------------------------------------------------------------

void QtPackageViewImpl::rootRequirementRemovedSlot( Model::Package* pPackage, Model::Requirement* pRemovedRequirement)
{
	rPackageView_.handleRootRequirementRemoved( pPackage, pRemovedRequirement);
}


} } // namespace Impl // namespace QtUI
